<template>
  <el-dialog
    width="500px"
    title="上传列表"
    v-model="show"
    class="rounded-[15px]"
    :close-on-click-modal="false"
    @close="showDialog(false)"
  >
    <el-empty description="暂无数据" class="w-1/1" v-show="$state.list.length === 0"></el-empty>
    <div v-for="(p, index) in $state.list" :key="index" v-show="$state.list.length !== 0">
      <div>
        <span>{{ p.filename }}</span>
      </div>
      <div>
        <el-progress
          :percentage="Math.ceil((p.nowIndex / p.chunkTotal) * 100)"
          :text-inside="true"
          :stroke-width="16"
        ></el-progress>
      </div>
    </div>
  </el-dialog>
</template>

<script setup lang="ts">
import { useUploadStore } from "@/stores/modules/upload";
import { computed } from "vue";
const { $state, showDialog } = useUploadStore();

const show = computed(() => {
  return $state.isShow;
});
</script>

<style></style>
